# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

# Initial PKGBUILD from AUR.
# Old Maintainer: Tom Wadley <tom@tomwadley.net>

pkgname=nvm
pkgver=0.40.1
pkgrel=1
pkgdesc='Node Version Manager - Simple bash script to manage multiple active node.js versions.'
url='https://github.com/nvm-sh/nvm'
arch=('any')
license=('MIT')
optdepends=('bash: bash completion')
install="$pkgname.install"
source=("https://github.com/nvm-sh/nvm/archive/v$pkgver.tar.gz"
        'init-nvm.sh'
        'install-nvm-exec')
sha512sums=('ccf4d43abc3c812ffc694e95770fef39bdd9963c77606636f1cd54dcd64a8ec3e338aa56ba907a81a671191eda6accbb0fcda25ccf14d439d7a7d7a96acfba4d'
            'b6a1906f644aa3cab17baeaf9e8bf0b256215b5fa082d73261095f45b5f16769fa91bccc597b22c2cfda0751b0e7f5865e2ff77176bb3e0998966be1fee5a76c'
            '148753d8d76cda4be75139628c04784b7abb70859d3815aa651bfd91a326b8c6b71897c27e7c1482c3255f271057ebc09147cbaba9faa36a66c2e6e2c6d4612a')

package() {
  cd "$pkgname-$pkgver"

  install -Dm 644 "$srcdir/init-nvm.sh" "$pkgdir/usr/share/$pkgname/init-nvm.sh"
  install -Dm 644 "$srcdir/install-nvm-exec" \
    "$pkgdir/usr/share/$pkgname/install-nvm-exec"
  install -Dm 644 nvm.sh "$pkgdir/usr/share/$pkgname/nvm.sh"
  install -Dm 755 nvm-exec "$pkgdir/usr/share/$pkgname/nvm-exec"
  install -Dm 644 bash_completion "$pkgdir/usr/share/$pkgname/bash_completion"
  install -Dm 644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

